﻿using Sdg.Domain.BizObj;
using Sdg.Domain.Repositories;
using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Dapper;

namespace Sdg.Dal.Repositories
{
    internal class Repository<TEntity> : IRepository<TEntity> where TEntity : IBizObj
    {
        protected SqlConnection _connection;

        public void SetConnection(string connStr)
        {
            _connection = new SqlConnection(connStr);            
        }

        public IEnumerable<TEntity> Select<TEntity>(string query, object param)
        {
            return _connection.Query<TEntity>(query, param);
        }



       
    }
}
